﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BaoCaoCaNhan.aspx.cs" Inherits="Viewer.BaoCao.BaoCaoCaNhan" %>

<%@ Register Src="~/ToChuc/UserControl/UCLookUpDiaChi.ascx" TagName="UCLookUpDiaChi"
    TagPrefix="uc" %>
<%@ Register Src="~/NhanSu/UserControl/UcToChuc.ascx" TagName="UcToChuc" TagPrefix="uc" %>
<%@ Register Src="~/NhanSu/UserControl/UCNhanVien.ascx" TagName="UCNhanVien" TagPrefix="uc" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../resources/css/main.css" rel="stylesheet" type="text/css" />
    <title>Untitled Page</title>
    <ext:XScript ID="XScipt1" runat="server">
    <script type="text/javascript">
  function MarkLookUp(id)
    {      
        #{hdStatus}.setValue(id);
    }
      function InsertEntity(number,name) {     
       
       
         if(  #{hdStatus}.getValue()=='ChoOHienNaySearch')
        {
            #{hdChoOThuongTruSearchId}.setValue(number);
            #{txtHoKhauThuongTruSearch}.setValue(name);            
        }
        
        }
        var filterTree = function(el, e) {
            var tree = TreePanel,
                text = this.getRawValue();

            tree.clearFilter();

            if (Ext.isEmpty(text, false)) {
                return;
            }

            if (e.getKey() === Ext.EventObject.ESC) {
                clearFilter();
            } else {
                var re = new RegExp(".*" + text + ".*", "i");

                tree.filterBy(function(node) {
                    return re.test(node.text);
                });
            }
        };
        var clearFilter = function() {
            var field = TriggerField1,
                tree = TreePanel;

            field.setValue("");
            tree.clearFilter();
            tree.getRootNode().collapseChildNodes(true);
            tree.getRootNode().ensureVisible();
        };

        var refreshTree = function(tree, result) {
            var nodes = eval(result);
            if (nodes.length > 0) {
                tree.initChildren(nodes);
            }
            else {
                tree.getRootNode().removeChildren();
            }
        }

        var TreePanel_Click = function(node) {
              Ext.net.Mask.show();  
            if (__currentNode.getValue() == node.id) return;
            __currentNode.setValue(node.id);
            X.LoadGrid(node.id);


        };
    </script>
    </ext:XScript>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="X"
        Locale="vi" />
    <ext:Hidden ID="hdIdCha" runat="server">
    </ext:Hidden>
    <ext:Hidden ID="hdIdDelete" runat="server">
    </ext:Hidden>
    <ext:Hidden runat="server" ID="hdStatus">
    </ext:Hidden>
    <div>
        <ext:Hidden ID="__currentNode" runat="server">
        </ext:Hidden>
        <ext:Viewport ID="Viewport1" runat="server">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <West>
                        <ext:TreePanel ID="TreePanel" runat="server" Width="200" Icon="ChartOrganisation"
                            AutoScroll="true">
                            <Listeners>
                                <Click Handler="TreePanel_Click(node);" />
                            </Listeners>
                            <TopBar>
                                <ext:Toolbar ID="Toolbar1" runat="server">
                                    <Items>
                                        <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="Tìm kiếm:" />
                                        <ext:ToolbarSpacer />
                                        <ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true">
                                            <Triggers>
                                                <ext:FieldTrigger Icon="Clear" />
                                            </Triggers>
                                            <Listeners>
                                                <KeyUp Fn="filterTree" Buffer="250" />
                                                <TriggerClick Handler="clearFilter();" />
                                            </Listeners>
                                        </ext:TriggerField>
                                    </Items>
                                </ext:Toolbar>
                            </TopBar>
                        </ext:TreePanel>
                    </West>
                    <Center>
                        <ext:Panel ID="pnl" runat="server" MonitorResize="true">
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" MonitorResize="true" Border="false">
                                    <Items>
                                        <ext:CompositeField ID="CompositeField1" runat="server" StyleSpec="margin-bottom:3px;">
                                            <Items>
                                                <ext:TextField ID="txtSoHieuCBCC" runat="server" EmptyText="Nhập số hiệu CBCC " Width="130" />
                                                <ext:TextField ID="txtHoTen" runat="server" EmptyText="Nhập họ & tên " Width="130" />
                                                <ext:TextField ID="txtSoCMND" runat="server" EmptyText="Nhập Số CMND " Width="130" />
                                                <ext:DisplayField ID="DisplayField1" runat="server" Width="20px" />
                                                <ext:LinkButton ID="lnlTimKiemNangCao" runat="server" Text="Tìm kiếm nâng cao" Icon="Add">
                                                    <Listeners>
                                                        <Click Handler=" Ext.net.Mask.show();" />
                                                    </Listeners>
                                                    <DirectEvents>
                                                        <Click OnEvent="showPanel">
                                                        </Click>
                                                    </DirectEvents>
                                                </ext:LinkButton>
                                                <ext:Button ID="Button3" runat="server" Text="Reset" IconAlign="Right">
                                                    <Listeners>
                                                        <Click Handler="Ext.net.Mask.show();#{DirectMethods}.ClearData();" />
                                                    </Listeners>
                                                </ext:Button>
                                                <ext:Button ID="btnSearch" runat="server" Icon="Zoom" Text="Tìm kiếm" IconAlign="Right">
                                                    <DirectEvents>
                                                        <Click OnEvent="btnSearch_Click">
                                                        </Click>
                                                    </DirectEvents>
                                                    <Listeners>
                                                        <Click Handler="Ext.net.Mask.show(); var a =#{ext-gen46};" />
                                                    </Listeners>
                                                </ext:Button>
                                            </Items>
                                        </ext:CompositeField>
                                      
                                        <ext:CompositeField ID="CompositeField3" runat="server" Hidden="true" StyleSpec="margin-bottom:3px;">
                                            <Items>
                                                <ext:Label ID="lbl" runat="server" Text="Số năm công tác" Width="130" />
                                                <ext:ComboBox ID="cbbToanTuCongTac" runat="server" Width="100" EmptyText="Toán tử">
                                                    <Items>
                                                        <ext:ListItem Text=">" Value="365" />
                                                        <ext:ListItem Text="<" Value="730" />
                                                        <ext:ListItem Text="=" Value="1095" />
                                                    </Items>
                                                    <Triggers>
                                                        <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                                    </Triggers>
                                                    <Listeners>
                                                        <Select Handler="this.triggers[0].show();" />
                                                        <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                                        <TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
                                                    </Listeners>
                                                </ext:ComboBox>
                                                <ext:TextField ID="txtNam" runat="server" Width="50" EmptyText="Năm">
                                                </ext:TextField>
                                                <ext:Checkbox ID="ckbTrangThaiNghiHuu" runat="server" BoxLabel="Hiển thị nhân viện đã nghỉ hưu" />
                                                <ext:Hidden runat="server" ID="hdChoOThuongTruSearchId">
                                                </ext:Hidden>
                                                <ext:Hidden ID="hdNodeId" runat="server">
                                                </ext:Hidden>
                                                <ext:Hidden ID="hdNodeName" runat="server">
                                                </ext:Hidden>
                                            </Items>
                                        </ext:CompositeField>
                                        <ext:CompositeField runat="server" ID="CompositeField4" Hidden="true" StyleSpec="margin-bottom:3px;">
                                            <Items>
                                                <ext:Label ID="Label1" runat="server" Text="Số năm vào đảng" Width="130" />
                                                <ext:ComboBox ID="cbbToanTuVaoDang" runat="server" Width="100" EmptyText="Toán tử">
                                                    <Items>
                                                        <ext:ListItem Text=">" Value="365" />
                                                        <ext:ListItem Text="<" Value="730" />
                                                        <ext:ListItem Text="=" Value="1095" />
                                                    </Items>
                                                    <Triggers>
                                                        <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                                    </Triggers>
                                                    <Listeners>
                                                        <Select Handler="this.triggers[0].show();" />
                                                        <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                                        <TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
                                                    </Listeners>
                                                </ext:ComboBox>
                                                <ext:TextField ID="txtNamVaoDang" runat="server" Width="50" EmptyText="Năm">
                                                </ext:TextField>
                                            </Items>
                                        </ext:CompositeField>
                                        <ext:CompositeField ID="CompositeField5" runat="server">
                                            <Items>
                                                <ext:Hidden ID="hdTimKiemNangCao" runat="server" />
                                            </Items>
                                        </ext:CompositeField>
                                    
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel2" runat="server" MonitorResize="true" Layout="Fit" Border="false"
                                    PaddingSummary="0 0 0 0" Margins="0">
                                    <Items>
                                        <ext:GridPanel ID="GridPanel1" runat="server" Height="490" AutoExpandColumn="QueQuan"
                                            AutoScroll="true" StripeRows="true" MonitorResize="true" Width="400">
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                    <ext:Column Header="Số hiệu CBCC" DataIndex="SoHieu" Width="100" />
                                                    <ext:Column Header="Tên" DataIndex="Ten" Resizable="true" Width="100" />
                                                    <ext:Column Header="Ngày sinh" DataIndex="NgaySinh" Resizable="true" Width="100" />
                                                    <ext:Column Header="Số CMND" DataIndex="SoCMND" Resizable="true" />
                                                    <ext:Column Header="Quê quán" DataIndex="QueQuan" Resizable="true" Width="130" />
                                                    <ext:Column Header="Chức vụ hiện tại" DataIndex="ChucVuHienTai" Resizable="true"
                                                        Width="100" />
                                                    <ext:Column Header="Cơ quan quản lí" DataIndex="CoQuanQL" Resizable="true" Width="130" />
                                                </Columns>
                                            </ColumnModel>
                                            <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                                                    <Listeners>
                                                        <RowDeselect Handler="#{MenuPanel1}.disable();" />
                                                        <RowSelect Handler="#{MenuPanel1}.enable();" />
                                                    </Listeners>
                                                </ext:RowSelectionModel>
                                            </SelectionModel>
                                            <Store>
                                                <ext:Store ID="storeNhanVien" runat="server" OnSubmitData="storeNhanVien_Submit">
                                                    <DirectEventConfig IsUpload="true">
                                                    </DirectEventConfig>
                                                    <Reader>
                                                        <ext:JsonReader IDProperty="Id">
                                                            <Fields>
                                                                <ext:RecordField Name="Id" />
                                                                <ext:RecordField Name="Ten" />
                                                                <ext:RecordField Name="NgaySinh" />
                                                                <ext:RecordField Name="SoCMND" />
                                                                <ext:RecordField Name="QueQuan" />
                                                                <ext:RecordField Name="ChucVuHienTai" />
                                                                <ext:RecordField Name="CoQuanQL" />
                                                                <ext:RecordField Name="SoHieu" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                </ext:Store>
                                            </Store>
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:Panel>
                    </Center>
                    <East>
                        <ext:Panel ID="Panel" runat="server" Title="Báo cáo liên quan" Width="200" Icon="Report"
                            Padding="5">
                            <Items>
                                <ext:Hidden ID="__ReportType" runat="server">
                                </ext:Hidden>
                                <ext:MenuPanel ID="MenuPanel1" runat="server" Disabled="true">
                                    <Menu ID="Menu3" runat="server">
                                        <Items>
                                            <ext:MenuItem ID="MenuItem1" runat="server" Text="Sơ yếu lí lịch" Icon="User">
                                                <Listeners>
                                                    <Click Handler="#{__ReportType}.setValue('SoYeuLyLich'); #{GridPanel1}.submitData(false);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem2" runat="server" Text="Quá trình công tác cá nhân" Icon="Group">
                                                <Listeners>
                                                    <Click Handler=" #{__ReportType}.setValue('QuaTrinhCongTacCaNhan');  #{GridPanel1}.submitData(false);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem3" runat="server" Text="Quá trình công tác Đảng" Icon="Group">
                                                <Listeners>
                                                    <Click Handler=" #{__ReportType}.setValue('QuaTrinhCongTacDang');  #{GridPanel1}.submitData(false);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem4" runat="server" Text="Quá trình nâng bậc, điều chỉnh"
                                                Icon="BrickAdd">
                                                <Listeners>
                                                    <Click Handler="#{__ReportType}.setValue('QuaTrinhNangBac');  #{GridPanel1}.submitData(false);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuSeparator />
                                        </Items>
                                    </Menu>
                                </ext:MenuPanel>
                            </Items>
                        </ext:Panel>
                    </East>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </div>
    <uc:UCLookUpDiaChi ID="UCLookUpDiaChi" runat="server"></uc:UCLookUpDiaChi>
    <uc:UcToChuc ID="UcToChuc" runat="server" />
    <uc:UCNhanVien ID="UCNhanVien" runat="server"></uc:UCNhanVien>
    </form>
</body>
</html>
